package com.neo.sk.models

import models.Tables
import models.Tables.MoTagRow
import org.slf4j.LoggerFactory
import slick.driver.MySQLDriver.simple._
import com.neo.sk.util.DBUtil._
/**
 * User: huangshanqi
 * Date: 2015/7/12
 * Time: 20:33
 */
object MovieTag {
  private final val logger = LoggerFactory.getLogger(getClass)


  def findAll  = db.withSession{
    implicit session  =>{
      Tables.MoTag.list
    }
  }

  def batchInsert(list: List[MoTagRow])  = db.withSession{
    implicit session  =>{
      Tables.MoTag ++= list
    }
  }

  def getAllTagName:List[String] = db.withSession{
    implicit session =>{
      Tables.MoTag.map(t => t.name).list
    }
  }
}
